Modding:Pockets
Example This example is slightly shortened for improved readability. Go to GitHub to see the unedited entry. { id: pck-grass name: txt-pck-grass-name flags: +jungle previewSprite: hud_worldmap_pocketPreview_grass.png slotMarker: hud_mapMarker_grass.png ambientSound: sfx_loop_grasslands_1 goals: gol-goldenTemple-buried locations: [ [ {ref: grp-village} {ref: grp-sanity-nature} { select: 3 group: [ {ref: grp-village} {ref: grp-sanity-nature} ] } ] [ {ref: grp-cave} {ref: grp-cave} {ref: grp-loot} ] ] borderBiome: [ {slots: 2, ref: bio-outside-sea} ] biomes: [ {ref: bio-grasslands-generic} {chance: 0.9, ref: bio-grasslands-jungle} { chance: 0.1 group: [ {slots: 1, group: grp-desert-sanity, reqDifficulty: 1..} {slots: 1, group: grp-drylands-sanity} ] } ] } Properties Biome Spawning in Pockets Spawning Biomes in a Pocket follows some special rules, since a Pocket has a defined maximum amount of Biomes as defined in the World entry containing the Pocket. Also, as with Locations, the list of spawned Modding:Biomes can be enhanced by using Selection Groups. So if the World that contains a given Pocket has this biomeCount defined biomeCount: 1 it means that the Pocket will be allowed to spawn 2 Biomes (2 wide / 1 high). Keep in mind that a Pocket can be part of many different World tunings, so you can almost never be certain how many Biomes exactly are allowed for a Pocket. For example, the typical Expedition 6 Pockets are allowed to spawn 6 Biomes. When a Pocket is generated it starts at the top of it's biomes list and keeps filling up the allowed amount of Biome until they are full. If the end of the list is reached before the allowed amount of Biomes is reached the list will start from the top again. Let's look at the biomes of pck-grass as an example (added line numbers for easier identification): 1 biomes: [ 2 {ref: bio-grasslands-generic} 3 {chance: 0.9, ref: bio-grasslands-jungle} 4 { 5 chance: 0.1 6 group: [ 7 {slots: 1, group: grp-desert-sanity, reqDifficulty: 1..} 8 {slots: 1, group: grp-drylands-sanity} 9 ] 10 } 11 {group: grp-grasslands-sanity} 12 { 13 chance: 0.3 14 reqWorld: 3.. 15 group: [ 16 {slots: 2, group: grp-desert-sanity, reqDifficulty: 1..} 17 {slots: 1, group: grp-drylands-sanity} 18 ] 19 } 20 {select: 5, group: grp-grasslands-sanity} 21 ] So let's say our Pocket of part of wd-world-4, which means it is allowed to spawn 4 Biomes (3 x 2 = 6 -blockedBiomes:2) . The generation will start at the top of the biomes section. Line 2: First Biome, bio-grasslands-generic is immediately picked as it has no requirements. 3 Biomes left. Line 3: With the chance of 0.9 the second Biome is successfully picked, bio-grasslands-jungle. 2 Biomes left. Line 4-1: The low chance of 0.1 fails, no Biome is picked, still 2 Biomes left. Line 11: One Biome of the group grp-grasslands-sanity is picked as it has no requirement. 1 Biome left. Line 15-19 Fails the chance of 0.3, no Biome is picked. 1 Biome left. Line 20: With no requirement, the last Biome is filled by one entry of the grp-grasslands-sanity group. So the final Biome selection of this example is: * 1 x bio-grasslands-generic * 1 x bio-grasslands-jungle * 2 x grp-grasslands-sanity Debugging Biome spawning An extremely helpful Hotkey for debugging the biomes section is X''' or '''Q in combination with B''' . While '''X and Q''' will uncover then full map, '''B will toggle the map between a schematic display of the used Biomes and their containing Locations.